//
//  RecordViewController.h
//  Growth
//
//  Created by 洪波 陈 on 5/18/12.
//  Copyright (c) 2012 MEETStudio. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AssetsLibrary/AssetsLibrary.h>

#import "LocationEngine.h"

#import "Photo.h"

#import "CJSONSerializer.h"

#import "Reachability.h"

#import "PublicDatabaseEngine.h"

#import "GrowthAppDelegate.h"

#import "SDDataCache.h"

#import "WebRequest.h"

#import "WebConnection.h"

#import <QuartzCore/QuartzCore.h>


#import "SDImageView+SDWebCache.h"

#import "ASIHTTPConnection.h"
#import "BlogMainViewViewController.h"

@interface RecordViewController : UIViewController
<UITextViewDelegate,
UINavigationControllerDelegate, 
UIImagePickerControllerDelegate,
LocationEngineDelegate,
UIActionSheetDelegate,
UIAlertViewDelegate,
ASIHTTPConnectionDelegate
>
{
    UIImage *photoImage;
    
    IBOutlet UIView *textBgView;
    IBOutlet UIView *recordView;
    IBOutlet UIView *bottomView;
    IBOutlet UIView *toolsView;
    
    IBOutlet UIView *photoUIView;
    IBOutlet UIImageView *imageView;
    
    IBOutlet UILabel *locationAdderssLabel;
    
    IBOutlet UITextView *recordTextView;
    
    IBOutlet UIButton *inputSourceButton;
    IBOutlet UIButton *inputSourceShowButton;
    
    IBOutlet UIScrollView *myScrollView;
    
    IBOutlet UILabel *charaterNum;
    
    //三方分享
    IBOutlet UIButton *sinaShareButton;
    
    
    //上传数据
    NSMutableArray *recordUploadArray;
    
    
    //用于存图片的发布时间
    NSString *dateStr;
    NSString *photoDateStr;
    
    //权限list
    NSMutableArray *publicList;
    
    //地理位置信息
    NSString *locationNameStr;
    
    NSString *theBodyString;
    
    int publicRate;
    
    //大事件标记
    BOOL _isSignForAnniversary;
    IBOutlet  UIImageView *signAnniversaryImageView;
    
    IBOutlet UILabel *addCommentLable;
    
    
}
@property (nonatomic, retain) UIImage *photoImage;

@property (nonatomic,retain)    IBOutlet UIImageView *imageView;

@property (nonatomic,retain)   IBOutlet UIView *photoUIView;



@property (nonatomic,retain)  NSString *dateStr;
@property (nonatomic, retain) NSString *photoDateStr;

@property (nonatomic, retain) NSString *locationNameStr;

@property (nonatomic,retain)   NSString *theBodyString;

- (id)initWithImage:(UIImage *)image;
- (id)initWithImage:(UIImage *)image photoDate:(NSString *)dateStr;
- (id)initWithThreadID:(int)threadId;


- (IBAction)takePhoto:(id)sender;
- (IBAction)AddLocation:(id)sender;
- (IBAction)showEmojiBoard:(id)sender;
- (IBAction)secretSetAction:(id)sender;
- (IBAction)showInputSourceAction:(id)sender;


- (void) registerForKeyboardNotifications;

//请求家人数据
- (void)loadFamilyData;


//标记为大事件
- (IBAction)signForAnniversary:(id)sender;

//数据上传
- (void)tryUpload;
- (void)uploadRecordData;



//发布记录
- (void)postRecordAction:(id)sender;
- (void)postAnniversary;

//输入验证
- (BOOL)isInputRight;

-(void)sendRecordData:(NSString *)theBodyString;

-(void)saveRecordData:(NSString *)theBodyString;

@end
